﻿SET(PRODUCT_NAME osgWidgetDLL)

SET(PRODUCT_FILES
	Export.h
    GraphicsWindowQt.h
    GraphicsWindowQt.cpp
	BaseSceneWidget.h
	BaseSceneWidget.cpp
	OSGSceneWidget.h
	OSGSceneWidget.cpp
)

#导出标志，在Export.h中用到
ADD_DEFINITIONS(-DEXPORT_LIBRARY)
#生成动态库
ADD_LIBRARY(${PRODUCT_NAME} SHARED ${PRODUCT_FILES})

# 设置工程所属文件夹
SET_PROPERTY(TARGET ${PRODUCT_NAME} PROPERTY FOLDER ${SOLUTION_FOLDER_NAME})

#链接Qt静态库
qt5_use_modules(${PRODUCT_NAME} Gui Core OpenGL)

#链接库
TARGET_LINK_LIBRARIES(${PRODUCT_NAME}
	debug osgd          optimized osg
	debug osgViewerd    optimized osgViewer
	debug osgDBd        optimized osgDB
    debug osgGAd        optimized osgGA
	debug OpenThreadsd  optimized OpenThreads
	${OPENGL_LIBRARIES} ${THIRD_PARTY_LIBRARIES}
)
#输出目录
SET_TARGET_PROPERTIES(${PRODUCT_NAME} PROPERTIES 
	ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/lib"
	ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/lib"
	LIBRARY_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/lib"
	LIBRARY_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/lib"
	RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin"
	RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin"
	DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}"
	RELEASE_POSTFIX "${CMAKE_RELEASE_POSTFIX}"
)

#安装目录
INSTALL(TARGETS ${PRODUCT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)